﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage_Home_admin.master" AutoEventWireup="true" CodeFile="Categories.aspx.cs" Inherits="admin_Product_Categories" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style2
        {
            text-align: center;
            width: 129px;
        }
        .style3
        {
            width: 129px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
     <asp:GridView ID="gvLoaiSP" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84" 
                    BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                    CellSpacing="2" DataKeyNames="TypeProduct_ID" 
            DataSourceID="categories">
                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                    <Columns>
                        <asp:BoundField DataField="TypeProduct_ID" HeaderText="TypeProduct_ID" 
                            ReadOnly="True" SortExpression="TypeProduct_ID" />
                        <asp:BoundField DataField="TypeProduct_Name" HeaderText="TypeProduct_Name" 
                            SortExpression="TypeProduct_Name" />
                        <asp:CommandField ShowEditButton="True" />
                        <asp:CommandField ShowDeleteButton="True" />
                    </Columns>
                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
                <asp:SqlDataSource ID="categories" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ShoppingOnlineConnectionString %>" 
            DeleteCommand="DELETE FROM [ProductType] WHERE [TypeProduct_ID] = @TypeProduct_ID" 
            InsertCommand="INSERT INTO [ProductType] ([TypeProduct_ID], [TypeProduct_Name]) VALUES (@TypeProduct_ID, @TypeProduct_Name)" 
            SelectCommand="SELECT * FROM [ProductType]" 
            UpdateCommand="UPDATE [ProductType] SET [TypeProduct_Name] = @TypeProduct_Name WHERE [TypeProduct_ID] = @TypeProduct_ID">
                    <DeleteParameters>
                        <asp:Parameter Name="TypeProduct_ID" Type="String" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="TypeProduct_Name" Type="String" />
                        <asp:Parameter Name="TypeProduct_ID" Type="String" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="TypeProduct_ID" Type="String" />
                        <asp:Parameter Name="TypeProduct_Name" Type="String" />
                    </InsertParameters>
        </asp:SqlDataSource>
                <br />
        <table width="400" border="0" cellspacing="4" cellpadding="0">
        <tr>
                    <td align="left" valign="top" class="style2">Categories ID</td>
                    <td align="left" valign="top" class="style1">
                        <asp:TextBox ID="txtCateID" runat="server" 
                            ontextchanged="txtCateID_TextChanged"></asp:TextBox>
                      </td>
                      
                  </tr>
                  <tr>
                    <td align="left" valign="top" class="style2">Categories Name</td>
                    <td align="left" valign="top" class="style1">
                        <asp:TextBox ID="txtCateName" runat="server"></asp:TextBox>
                      </td>
                      
                  </tr>
                  <tr>
                    <td align="left" valign="top" class="style3">
                        <asp:Button ID="btnAdd" runat="server" Text="Add" onclick="btnAdd_Click" />
                      </td>
                    <td align="left" valign="top">&nbsp;</td>
                  </tr>
                </table>
               
    </p>
</asp:Content>

